import Vue from "vue"
import Router from "vue-router"

Vue.use(Router)

const Home = () => import("@/pages/home/Home.vue")
const Category = () => import("@/pages/category/Category.vue")
const Profile = () => import("@/pages/profile/Profile.vue")
const Cart = () => import("@/pages/cart/Cart.vue")
const NotFound = () => import("@/components/error/NotFound.vue")

const routes = [
  {
    path: "",
    redirect: { name: "home" }
  },
  {
    path: "/home",
    name: "home",
    component: Home
  },
  {
    path: "/category",
    name: "category",
    component: Category
  },
  {
    path: "/cart",
    name: "cart",
    component: Cart
  },
  {
    path: "/profile",
    name: "profile",
    component: Profile
  },
  {
    path: "*",
    component: NotFound
  }
]

export default new Router({
  routes: routes,
  mode: "history"
})
